/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb;

import java.util.HashSet;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;

/**
 *
 * @author abdou
 */
@Stateless
public class GestoreLibri implements GestoreLibriLocal {
    @EJB
    private LibFacadeLocal libFacade;

    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")
    
    @Override
    public void aggiungiLibro(String titolo, String autore ){
        Lib l = new Lib();
        l.setTitolo(titolo);
        l.setAutore(autore);
        libFacade.create(l);   
    }
    
    @Override
    public List<Lib> getLibri() {
        List<Lib> listaLibri = libFacade.findAll();
        return listaLibri;
    }    
}
